<head th:include="~{common/header::header}" />
<title>代码&amp;视觉|多角度着眼，多维度审视</title>
<body class="fixed-nav bg-dark" id="page-top">
	<!-- Navigation-->
	<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top" id="mainNav">
		<a class="navbar-brand" href="index.html"><img th:src="@{/customer/img/logo.png}"></a>

		<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
			<span class="navbar-toggler-icon"></span>
		</button>

		<div class="collapse navbar-collapse" id="navbarResponsive">

			<ul class="navbar-nav navbar-sidenav" id="accordion">
				<li id="sysResource" style="width: 200px"></li>
			</ul>

			<ul class="navbar-nav ml-auto">
				<li class="nav-item dropdown"><a class="nav-link dropdown-toggle mr-lg-2" id="messagesDropdown" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="fa fa-fw fa-envelope"></i> <span class="d-lg-none">消息 <span class="badge badge-pill badge-primary">2 New</span>
					</span> <span class="indicator text-primary d-none d-lg-block"> <i class="fa fa-fw fa-circle"></i></span>
				</a>

					<div class="dropdown-menu" aria-labelledby="messagesDropdown">
						<h6 class="dropdown-header">新消息:</h6>
						<div class="dropdown-divider"></div>
						<a class="dropdown-item" href="#"> <strong>Calvin Wu</strong> <span class="small text-muted">11:21 上午</span> <span class="dropdown-message small">消息模块开发进行中，敬请期待!</span>
						</a>
						<div class="dropdown-divider"></div>
						<a class="dropdown-item" href="#"> <strong>Calvin Wu</strong> <span class="small text-muted">1:22 下午</span> <span class="dropdown-message small">下午设计了网站logo图片并已上线!</span>
						</a>

						<div class="dropdown-divider"></div>
						<a class="dropdown-item small" href="#">所有消息</a>
					</div></li>

				<li class="nav-item dropdown"><a class="nav-link dropdown-toggle mr-lg-2" id="alertsDropdown" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="fa fa-fw fa-bell"></i> <span class="d-lg-none">警告 <span class="badge badge-pill badge-warning">3 New</span>
					</span> <span class="indicator text-warning d-none d-lg-block"> <i class="fa fa-fw fa-circle"></i>
					</span>
				</a>
					<div class="dropdown-menu" aria-labelledby="alertsDropdown">
						<h6 class="dropdown-header">新警告:</h6>
						<div class="dropdown-divider"></div>
						<a class="dropdown-item" href="#"> <span class="text-success"> <strong><i class="fa fa-long-arrow-up fa-fw"></i>状态更新</strong></span> <span class="small text-muted">5:51 下午</span> <span class="dropdown-message small">数据库漏洞已修复.</span>
						</a>
						<div class="dropdown-divider"></div>
						<a class="dropdown-item" href="#"> <span class="text-danger"> <strong><i class="fa fa-long-arrow-down fa-fw"></i>状态更新</strong>
						</span> <span class="small text-muted">3:23 下午</span> <span class="dropdown-message small">数据库暴力攻击排查.</span>
						</a>
						<div class="dropdown-divider"></div>
						<a class="dropdown-item" href="#"> <span class="text-success"> <strong><i class="fa fa-long-arrow-up fa-fw"></i>创建警告</strong>
						</span> <span class="small text-muted">1:11 下午</span> <span class="dropdown-message small">数据库被暴力攻击.</span>
						</a>
						<div class="dropdown-divider"></div>
						<a class="dropdown-item small" href="#">所有警告</a>
					</div></li>

				<li class="nav-item"><a href="javascript:;" class="nav-link"><i class="fa fa-user" aria-hidden="true"></i><span sec:authorize="hasRole('ADMIN')"> 欢迎您 <span id="username" sec:authentication="name"></span></span> <span id="roles" sec:authentication="principal.authorities[0]" style="display: none"></span> </a></li>

				<li class="nav-item">
					<form id="subform" th:action="@{/logout}" method="post">
						<a href="javascript:;" class="nav-link" onclick="document.getElementById('subform').submit();return false"><i class="fa fa-fw fa-sign-out"></i>退了</a>
					</form>
				</li>

			</ul>
		</div>
	</nav>

	<div class="content-wrapper">

		<div id="main" class="container-fluid">
			<img th:src="@{customer/img/console_backgroud.png}">
		</div>

		<a class="scroll-to-top rounded" href="#page-top"> <i class="fa fa-angle-up"></i></a>

	</div>

	<div th:insert="~{common/footer :: footer}"></div>

	<script type="text/javascript">
	function getTree() {
		var datas;
		var data =$("#roles").text();
		$.ajax({
			url : "resource.json",
			async : false,
			data:{"roles":data},
			type:"POST",
			success : function(result) {
				datas = result;
			}
		});
		return datas;
	}

	$(function() {
		$('#sysResource').treeview({
			levels : 5,
			collapseIcon : "fa fa-minus",
			expandIcon : "fa fa-plus",
			enableLinks: true,
			backColor:"#010A13",
			data: getTree()
		});
		
	$(document).delegate("[url^='console']", 'click', function() {
				$("#main").load($(this).attr('url'));
				return false;
			});
	})
	</script>
</body>